package com.onesports.intelligent.k12.polarlight.enums;

import com.baomidou.mybatisplus.annotation.IEnum;
import com.fasterxml.jackson.annotation.JsonValue;
import com.onesports.framework.kit.common.util.ParamUtils;
import com.onesports.intelligent.k12.polarlight.annotation.SysDict;

/**
 * 订单状态枚举类
 *
 * @author Wu
 * */
@SysDict(value = "订单分账类型",code = "OrderSubType")
public enum OrderSubTypeEnum implements IEnum<String> {

    /**
     * 订单状态枚举类
     */
    HEAD("1","团长分账"),
    COACH("2","教练分账"),
    CAMPUS("3","社区分账"),
    ORGANIZATION("4","运营团队分账"),
    PLATFORM("5","平台分账"),
    ;

    private String value;
    private String label;

    OrderSubTypeEnum(String value, String label) {
        this.value = value;
        this.label = label;
    }

    @Override
    public String getValue() {
        return value;
    }

    @JsonValue
    public String getLabel() {
        return this.label;
    }



    public static OrderSubTypeEnum of(String desc) {
        for (OrderSubTypeEnum status : OrderSubTypeEnum.values()) {
            if (ParamUtils.equals(status.label, desc)) {
                return status;
            }
        }
        return null;
    }
}
